<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Merge 3 files into one</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.xdiff-file-diff.html">« xdiff_file_diff</a></li>
      <li style="float: right;"><a href="function.xdiff-file-patch-binary.html">xdiff_file_patch_binary »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.xdiff.html">xdiff 函数</a></li>
    <li>Merge 3 files into one</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.xdiff-file-merge3" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xdiff_file_merge3</h1>
  <p class="verinfo">(PECL xdiff &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">xdiff_file_merge3</span> &mdash; <span class="dc-title">Merge 3 files into one</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.xdiff-file-merge3-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>xdiff_file_merge3</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$old_file</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$new_file1</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$new_file2</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$dest</code></span><br>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>

  <p class="para rdfs-comment">
   Merges three files into one and stores the result in a file <code class="parameter">dest</code>. 
   The <code class="parameter">old_file</code> is an original version while <code class="parameter">new_file1</code>
   and <code class="parameter">new_file2</code> are modified versions of an original.   
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xdiff-file-merge3-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">old_file</code></dt>

     <dd>

      <p class="para">
       Path to the first file. It acts as &quot;old&quot; file.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">new_file1</code></dt>

     <dd>

      <p class="para">
       Path to the second file. It acts as modified version of <code class="parameter">old_file</code>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">new_file2</code></dt>

     <dd>

      <p class="para">
       Path to the third file. It acts as modified version of <code class="parameter">old_file</code>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">dest</code></dt>

     <dd>

      <p class="para">
       Path of the resulting file, containing merged changed from both <code class="parameter">new_file1</code> and
       <code class="parameter">new_file2</code>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xdiff-file-merge3-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>true</code></strong> if merge was successful, string with rejected chunks if
   it was not or <strong><code>false</code></strong> if an internal error happened.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.xdiff-file-merge3-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2246">
    <p><strong>示例 #1 <span class="function"><strong>xdiff_file_merge3()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     The following code merges three files into one.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$old_version&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'original_script.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$fix1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'script_with_fix1.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$fix2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'script_with_fix2.php'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$errors&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">xdiff_file_merge3</span><span style="color: #007700">(</span><span style="color: #0000BB">$old_version</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$fix1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$fix2</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'fixed_script.php'</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">is_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$errors</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Rejects:\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$errors</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.xdiff-file-merge3-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.xdiff-string-merge3.html" class="function" rel="rdfs-seeAlso">xdiff_string_merge3()</a> - Merge 3 strings into one</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>